package com.erp.shiro;

import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;

import javax.annotation.PostConstruct;

public abstract class ShiroRealm extends AuthorizingRealm {

    @Override
    protected abstract AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection);

    @Override
    protected abstract AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException;

    @PostConstruct
    public abstract void initCredentialsMatcher() ;

}
